Skip to content

fix(render): align scrollToRowPosition from the row's actual offsetTop - #4930

Open
lukecotter wants to merge 2 commits into
tabulator-tables:masterfrom
lukecotter:fix/render-scroll-to-row-position
Open

lukecotter wants to merge 2 commits into
tabulator-tables:masterfrom
lukecotter:fix/render-scroll-to-row-position

Conversation

@lukecotter

@lukecotter lukecotter commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem

scrollToRowPosition computed the target offset from the estimated row height rather than the row's actual position, so top / center / bottom alignment drifted on variableheight rows.

Fix

Align from the row's actual offsetTop, now lands within 6px.

Test

test/e2e/scroll-to-row-position.spec.ts.

Performance

Neutral. 500k rows, K=5, medians:

Metric Before After
initial render (ms) 97.6 102.1
initial render, variable heights (ms) 105.6 101.4
fling churn, uniform 14205 14205
fling churn, variable 3935 3935

scrollToRowPosition's center/bottom math derived the offset from the current
scrollTop, assuming scrollToRow had placed the target at the top of the
window. For rows that cannot sit at the top after the fill (e.g. near the
end of the list) this misaligned them — measured ~12px off for center.
Compute the alignment from the row's actual offsetTop instead, and sync
vDomScrollPosTop/Bottom afterwards so the next user scroll does not diff
against a stale tracker and jump (guarded for the basic renderer).

Adds a Playwright regression test asserting a near-bottom row lands within
6px of top/center/bottom.
@lukecotter
lukecotter marked this pull request as ready for review October 2, 2026 15:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants